/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class ListBasededatosv5Data {
	private static final int ROW_COUNT = 100;
	
public void listTestData() throws PersistentException {
		orm.DAOFactory lDAOFactory = orm.DAOFactory.getDAOFactory();
		System.out.println("Listing Trp_region...");
		orm.Trp_region[] ormTrp_regions = lDAOFactory.getTrp_regionDAO().listTrp_regionByQuery(null, null);
		int length = Math.min(ormTrp_regions.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTrp_regions[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Trp_provincia...");
		orm.Trp_provincia[] ormTrp_provincias = lDAOFactory.getTrp_provinciaDAO().listTrp_provinciaByQuery(null, null);
		length = Math.min(ormTrp_provincias.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTrp_provincias[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Trp_sexo...");
		orm.Trp_sexo[] ormTrp_sexos = lDAOFactory.getTrp_sexoDAO().listTrp_sexoByQuery(null, null);
		length = Math.min(ormTrp_sexos.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTrp_sexos[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Trp_curso...");
		orm.Trp_curso[] ormTrp_cursos = lDAOFactory.getTrp_cursoDAO().listTrp_cursoByQuery(null, null);
		length = Math.min(ormTrp_cursos.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTrp_cursos[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Trp_colegio...");
		orm.Trp_colegio[] ormTrp_colegios = lDAOFactory.getTrp_colegioDAO().listTrp_colegioByQuery(null, null);
		length = Math.min(ormTrp_colegios.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTrp_colegios[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Trp_alumno...");
		orm.Trp_alumno[] ormTrp_alumnos = lDAOFactory.getTrp_alumnoDAO().listTrp_alumnoByQuery(null, null);
		length = Math.min(ormTrp_alumnos.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTrp_alumnos[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Trp_nivel...");
		orm.Trp_nivel[] ormTrp_nivels = lDAOFactory.getTrp_nivelDAO().listTrp_nivelByQuery(null, null);
		length = Math.min(ormTrp_nivels.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTrp_nivels[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Trp_tipo_coleg...");
		orm.Trp_tipo_coleg[] ormTrp_tipo_colegs = lDAOFactory.getTrp_tipo_colegDAO().listTrp_tipo_colegByQuery(null, null);
		length = Math.min(ormTrp_tipo_colegs.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTrp_tipo_colegs[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Trp_socio_eco...");
		orm.Trp_socio_eco[] ormTrp_socio_ecos = lDAOFactory.getTrp_socio_ecoDAO().listTrp_socio_ecoByQuery(null, null);
		length = Math.min(ormTrp_socio_ecos.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTrp_socio_ecos[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
		System.out.println("Listing Trp_datos...");
		orm.Trp_datos[] ormTrp_datoses = lDAOFactory.getTrp_datosDAO().listTrp_datosByQuery(null, null);
		length = Math.min(ormTrp_datoses.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTrp_datoses[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
	}
	
	public void listByCriteria() throws PersistentException  {
		System.out.println("Listing Trp_region by Criteria...");
		orm.Trp_regionCriteria trp_regionCriteria = new orm.Trp_regionCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//trp_regionCriteria.re_id_region.eq();
		trp_regionCriteria.setMaxResults(ROW_COUNT);
		orm.Trp_region[] ormTrp_regions = trp_regionCriteria.listTrp_region();
		int length =ormTrp_regions== null ? 0 : Math.min(ormTrp_regions.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTrp_regions[i]);
		}
		System.out.println(length + " Trp_region record(s) retrieved."); 
		
		System.out.println("Listing Trp_provincia by Criteria...");
		orm.Trp_provinciaCriteria trp_provinciaCriteria = new orm.Trp_provinciaCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//trp_provinciaCriteria.pr_id_prov.eq();
		trp_provinciaCriteria.setMaxResults(ROW_COUNT);
		orm.Trp_provincia[] ormTrp_provincias = trp_provinciaCriteria.listTrp_provincia();
		length =ormTrp_provincias== null ? 0 : Math.min(ormTrp_provincias.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTrp_provincias[i]);
		}
		System.out.println(length + " Trp_provincia record(s) retrieved."); 
		
		System.out.println("Listing Trp_sexo by Criteria...");
		orm.Trp_sexoCriteria trp_sexoCriteria = new orm.Trp_sexoCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//trp_sexoCriteria.se_id_cod_sexo.eq();
		trp_sexoCriteria.setMaxResults(ROW_COUNT);
		orm.Trp_sexo[] ormTrp_sexos = trp_sexoCriteria.listTrp_sexo();
		length =ormTrp_sexos== null ? 0 : Math.min(ormTrp_sexos.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTrp_sexos[i]);
		}
		System.out.println(length + " Trp_sexo record(s) retrieved."); 
		
		System.out.println("Listing Trp_curso by Criteria...");
		orm.Trp_cursoCriteria trp_cursoCriteria = new orm.Trp_cursoCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//trp_cursoCriteria.cu_id.eq();
		trp_cursoCriteria.setMaxResults(ROW_COUNT);
		orm.Trp_curso[] ormTrp_cursos = trp_cursoCriteria.listTrp_curso();
		length =ormTrp_cursos== null ? 0 : Math.min(ormTrp_cursos.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTrp_cursos[i]);
		}
		System.out.println(length + " Trp_curso record(s) retrieved."); 
		
		System.out.println("Listing Trp_colegio by Criteria...");
		orm.Trp_colegioCriteria trp_colegioCriteria = new orm.Trp_colegioCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//trp_colegioCriteria.co_id.eq();
		trp_colegioCriteria.setMaxResults(ROW_COUNT);
		orm.Trp_colegio[] ormTrp_colegios = trp_colegioCriteria.listTrp_colegio();
		length =ormTrp_colegios== null ? 0 : Math.min(ormTrp_colegios.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTrp_colegios[i]);
		}
		System.out.println(length + " Trp_colegio record(s) retrieved."); 
		
		System.out.println("Listing Trp_alumno by Criteria...");
		orm.Trp_alumnoCriteria trp_alumnoCriteria = new orm.Trp_alumnoCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//trp_alumnoCriteria.al_id_rut.eq();
		trp_alumnoCriteria.setMaxResults(ROW_COUNT);
		orm.Trp_alumno[] ormTrp_alumnos = trp_alumnoCriteria.listTrp_alumno();
		length =ormTrp_alumnos== null ? 0 : Math.min(ormTrp_alumnos.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTrp_alumnos[i]);
		}
		System.out.println(length + " Trp_alumno record(s) retrieved."); 
		
		System.out.println("Listing Trp_nivel by Criteria...");
		orm.Trp_nivelCriteria trp_nivelCriteria = new orm.Trp_nivelCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//trp_nivelCriteria.ni_id_nivel.eq();
		trp_nivelCriteria.setMaxResults(ROW_COUNT);
		orm.Trp_nivel[] ormTrp_nivels = trp_nivelCriteria.listTrp_nivel();
		length =ormTrp_nivels== null ? 0 : Math.min(ormTrp_nivels.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTrp_nivels[i]);
		}
		System.out.println(length + " Trp_nivel record(s) retrieved."); 
		
		System.out.println("Listing Trp_tipo_coleg by Criteria...");
		orm.Trp_tipo_colegCriteria trp_tipo_colegCriteria = new orm.Trp_tipo_colegCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//trp_tipo_colegCriteria.tc_id_tipo.eq();
		trp_tipo_colegCriteria.setMaxResults(ROW_COUNT);
		orm.Trp_tipo_coleg[] ormTrp_tipo_colegs = trp_tipo_colegCriteria.listTrp_tipo_coleg();
		length =ormTrp_tipo_colegs== null ? 0 : Math.min(ormTrp_tipo_colegs.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTrp_tipo_colegs[i]);
		}
		System.out.println(length + " Trp_tipo_coleg record(s) retrieved."); 
		
		System.out.println("Listing Trp_socio_eco by Criteria...");
		orm.Trp_socio_ecoCriteria trp_socio_ecoCriteria = new orm.Trp_socio_ecoCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//trp_socio_ecoCriteria.so_id_socio_e.eq();
		trp_socio_ecoCriteria.setMaxResults(ROW_COUNT);
		orm.Trp_socio_eco[] ormTrp_socio_ecos = trp_socio_ecoCriteria.listTrp_socio_eco();
		length =ormTrp_socio_ecos== null ? 0 : Math.min(ormTrp_socio_ecos.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTrp_socio_ecos[i]);
		}
		System.out.println(length + " Trp_socio_eco record(s) retrieved."); 
		
		System.out.println("Listing Trp_datos by Criteria...");
		orm.Trp_datosCriteria trp_datosCriteria = new orm.Trp_datosCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//trp_datosCriteria.da_id_datos.eq();
		trp_datosCriteria.setMaxResults(ROW_COUNT);
		orm.Trp_datos[] ormTrp_datoses = trp_datosCriteria.listTrp_datos();
		length =ormTrp_datoses== null ? 0 : Math.min(ormTrp_datoses.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTrp_datoses[i]);
		}
		System.out.println(length + " Trp_datos record(s) retrieved."); 
		
	}
	
	public static void main(String[] args) {
		try {
			ListBasededatosv5Data listBasededatosv5Data = new ListBasededatosv5Data();
			try {
				listBasededatosv5Data.listTestData();
				//listBasededatosv5Data.listByCriteria();
			}
			finally {
				orm.Basededatosv5PersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
